// key为组件名称，值为校验方法
const obj = {
    ycAgreedInterestRate: (options = {})=>{
        let {required = false,} = options
        return [
            {required:required,message:'aaaaaa',trigger:'blur'},
            {trigger:'blur',validator: (rule, value, callback) => {
                setTimeout(() => {
                    callback(new Error('校验不通过'));// 校验通过
                }, 1000);
            }}
        ]
    },
    ycAudioStreamIdentifier: (options = {})=>{
        let {required = false,} = options
        let rules = []
        if (required) {
            rules.push({required:required,message:'请输入必填项',trigger:'blur'})
        }
        rules.push({
            trigger:'blur',validator: (rule, value = '', callback) => {
                if (!(value.length < 4 && value.length >= 0)) {
                    callback()
                } else {
                    callback(new Error('至少输入4位'));// 校验通过
                }
            }            
        })
        return rules
    },
}
let proxyObj = new Proxy(obj, {
    get (target, property) {
        if (!target[property]) {
            target[property] = ()=>[]
        }
        return target[property]
    }
}) 
export default proxyObj
